<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    
    <title>My JSP 'p2.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<%@ include file="/WEB-INF/view/common/kendocommon.jsp"%>

	<script src="${basepath}/js/LodopFuncs.js"></script>
    
<script language="javascript" type="text/javascript">        
        var LODOP; //声明为全局变量  
        //myAddHtml();
        
 //       $(document).ready(function() {
			//myAddHtml();
			//LODOP.PREVIEW();
  //      });
        
        function myPrint(){
        	LODOP=getLodop();         
	   		LODOP.PRINT_INIT("打印测试");	
	   		//LODOP.SET_PRINT_PAGESIZE(3,58mm,document.getElementById("textarea01").offsetHeight,"");		
	   		LODOP.SET_PRINT_PAGESIZE(3,580,40,"");	
			LODOP.ADD_PRINT_HTM(10,5,"100%","100%",document.getElementById("textarea01").innerHTML);
			LODOP.PRINT();
    	}
        
        function myAddHtml(){
    		LODOP=getLodop();         
	   		LODOP.PRINT_INIT("打印测试");		
	   		LODOP.SET_PRINT_PAGESIZE(3,580,40,"");	
			LODOP.ADD_PRINT_HTM(10,5,"100%","100%",document.getElementById("textarea01").innerHTML);
			//LODOP.SET_SHOW_MODE("PREVIEW_IN_BROWSE",true);
			LODOP.PREVIEW();
    	}
        
        function myDesign(){
        	//console.log("======>"+document.getElementById("textarea01").offsetHeight);
    		LODOP=getLodop();         
	   		LODOP.PRINT_INIT("打印测试");		
	   		LODOP.SET_PRINT_PAGESIZE(3,580,40,"");	
			LODOP.ADD_PRINT_HTM(10,5,"100%","100%",document.getElementById("textarea01").innerHTML);
			//LODOP.SET_SHOW_MODE("PREVIEW_IN_BROWSE",true);
			LODOP.PRINT_DESIGN();
    	}
</script>  

  </head>
  
 <body >

<button href="#" onclick="myPrint()">打印</button>
或<a href="javascript:;" onclick="myAddHtml()">预览</a>
或<a href="javascript:;" onclick="myDesign()">设置</a>
</td>        
 
<div id="textarea01">
<table >
  <tr>
    <td width="100%" >
      <p align="center"> 
      <p align="center"><font face="宋体" size="2">科学家</font></p>
      <p align="left"><font face="宋体" size="2">　地址：中国北京社会科学</font></p>
      ------------------------------------
      <p align="left"><font face="宋体" size="2">　电话：010-88811888</font></p>
      <p align="left"><font face="宋体" size="2">　电话：010-88811888</font></p>
      <p align="left"><font face="宋体" size="2">　电话：010-88811888</font></p>
      <p align="left"><font face="宋体" size="2">　电话：010-88811888</font></p>
      <p align="left"><font face="宋体" size="2">　电话：010-88811888</font></p>
      <p align="left"><font face="宋体" size="2">　电话：010-88811888</font></p>
      <p align="left"><font face="宋体" size="2">　电话：010-88811888</font></p>
      <p align="left"><font face="宋体" size="2">　电话：010-88811888</font></p>
      <p align="left"><font face="宋体" size="2">　电话：010-88811888</font></p>
    </td>
  </tr>

</table>
</textarea>       
    
<script language="javascript" type="text/javascript">        
        var LODOP; //声明为全局变量       
        $(document).ready(function() {
        	alert('xxxxx');
        	debugger;
        	console.log('LODOP');
	var myAddHtml=function {  
		
		debugger;
		LODOP=getLodop();         
   		LODOP.PRINT_INIT("");		
   		LODOP.ADD_PRINT_HTM(10,5,"100%","100%",document.getElementById("textarea01").innerHTML);
		//LODOP.ADD_PRINT_HTM(10,55,"100%","100%",document.getElementById("textarea01").value);	       
	};	  
	myAddHtml();
        })
</script>        
       
      <%String html=request.getParameter("html");
  %>
   <div style="width:270px;padding-right:20px;page-break-after:always" id="receipt" >
  <%=html%>
  </div>   

</div>       
 

</body>    
</html>

